package com.jk.controller;

import com.jk.entity.OrderEntity;
import com.jk.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    private OrderService orderService;
    //新增
    @RequestMapping("addorder")
    public void addorder(OrderEntity orderEntity){
        orderService.addorder(orderEntity);
    }

    //id查询
    @RequestMapping("getlistorder")
    public List<OrderEntity> getlistorder(Integer userId){
        return orderService.getlistorder(userId);
    }

}
